<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>huadong</title>
    <link rel="stylesheet" href="dan.css">

</head>

<body>
    <div class="container">
        <div class="top"></div>
        <div class="bottom">

            <div class="title">list</div>
            <div>
                <ul>
                    <li>
                        <div class="box1 box lishow">
                            <img class="picture" src="/images/雨路.jpg" alt="">
                            <div class="content">
                                <h5 class="name">name1</h5>
                                <p class="p1">ababababababababababababba</p>
                            </div>
                        </div>
                    </li>

                    <li>
                        <div class="box2 box">
                            <img class="picture" src="/images/树.jpg" alt="">
                            <div class="content">
                                <h5 class="name">name2</h5>
                                <p class="p2">ababababababababababababba</p>
                            </div>
                        </div>
                    </li>

                    <li>
                        <div class="box3 box">
                            <img class="picture" src="/images/落日.jpg" alt="">
                            <div class="content">
                                <h5 class="name">name3</h5>
                                <p class="p3">ababababababababababababba</p>
                            </div>
                        </div>
                    </li>

                    <li>
                        <div class="box4 box">
                            <img class="picture" src="/images/路.jpg" alt="">
                            <div class="content">
                                <h5 class="name">name4</h5>
                                <p class="p4">ababababababababababababba</p>
                            </div>
                        </div>
                    </li>

                    <li>
                        <div class="box5 box">
                            <img class="picture" src="/images/鬼屋.jpg" alt="">
                            <div class="content">
                                <h5 class="name">name5</h5>
                                <p class="p5">ababababababababababababba</p>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>

        </div>
    </div>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
    <script type="application/javascript">
        $(function(){

            $(document).on('scroll',function(){
                var h=$(window).scrollTop();
                var maxh=$(document).height();
                var currh=$(window).height();
                var num =Math.ceil((h-100)/160);
                var str=".box"+num;

                if(h>100 && h<(maxh-currh-1)){
                    $(str).addClass('lishow');
                }else if(h>=maxh-currh-1){
                    $('.box').addClass('lishow');
                }else{
                    $('.box').removeClass('lishow');
                }
            })
        })
    </script>
</body>

</html>